<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="das" type="hidden" th:value="${roomMap}"/>
<button onclick="dsa()">dsadasdd</button>
[[${roomMap}]]
<script>

    function dsa() {
        var ds = document.getElementById('das').value;
        var sd = JSON.parse(ds);
        alert(sd);
    }
</script>
</body>

</html>